package com.hevs.adibilis;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class MainActivity extends Activity implements OnClickListener {

	
	private Button buttonAllActivites;
	private Button buttonSearchActivites;
	private Button buttonClosestActivities;
	
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        buttonAllActivites = (Button) findViewById(R.id.buttonAllActivites);
        buttonSearchActivites = (Button) findViewById(R.id.buttonSearchActivities);
        buttonClosestActivities = (Button) findViewById(R.id.nearestActivityButton);
        
        buttonAllActivites.setOnClickListener(this);
        buttonSearchActivites.setOnClickListener(this);
        buttonClosestActivities.setOnClickListener(this);
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }


	@Override
	public void onClick(View v) {

		if(v == this.buttonAllActivites){
			
			Intent intent = new Intent(this, CategoriesActivity.class);
			startActivity(intent);

		}
		
		if(v == this.buttonSearchActivites){
			
			Intent intent = new Intent(this, SearchActivities.class);
			startActivity(intent);

		}
		
		if(v == this.buttonClosestActivities){
			
			Intent intent = new Intent(this, CloseActivities.class);
			startActivity(intent);

		}
		
	}
    
}
